<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function AtoB(a,b){
            let sum = 0 ; 
            for( let i = a ; i <= b ; i ++ ){
                for( let j = i + 1 ; j <= b ; j++ ){
                    sum = sum + 2 * ( i * j ) ; 
                }
            }
            return sum ; 
        }
        console.log(AtoB(1,100));
        // 25164150
    </script>
</body>
</html>